<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ include file="/WEB-INF/component/commonTagLib.jsp"%>
<!DOCTYPE html>
<html>
<head>
	<title><spring:message code="message.jieSuan.jiaoKuanTongZhiShu"/><spring:message code="message.jqGrid.cz.xiangQing"/></title>
	<%@ include file="/WEB-INF/component/commonCSS.jsp"%>
    <!--[if lt IE 9]>
        <script src="lib/js/html5shiv.min.js"></script>
        <script src="lib/js/respond.min.js"></script>
    <![endif]-->
 	
   
</head>
<body class="skin-blue-light sidebar-mini fixed skin-blue-light-frame">
    <section class="content-header">
        <h1><spring:message code="message.listForm.yiLiaoJiGou"/><spring:message code="message.jieSuan.jiaoKuanTongZhiShu"/><spring:message code="message.jqGrid.cz.xiangQing"/></h1>
        <ol class="breadcrumb">
            <li><a href="${ctx }/home.jsp"><i class="fa fa-home"></i><spring:message code="message.lable.first"/></a></li>
           <li class="active"><spring:message code="message.jieSuan.jiaoKuanDanGuanLi"/></li>
            <li class="active"><spring:message code="message.listForm.yiLiaoJiGou"/><spring:message code="message.jieSuan.jiaoKuanTongZhiShu"/><spring:message code="message.button.look"/></li>
        </ol>
    </section>
    
    <section class="content">
        <div class=" box box-success">
            <div class="box-body">
                <div class="input">
                	<div class="textalign1"><spring:message code="message.jieSuan.shangPinBianMa"/><spring:message code="message.yanZheng.maoHao"/></div>
                        <div class="boxinput">
                        <input type="text" class="textinput" id="goodsCode" placeholder="<spring:message code="message.jieSuan.shangPinBianMa"/>" />
                    	</div>
                    <div class="textalign" >
                    <button type="button" class="btn btn-success btn-sm" onclick="gridSerch();" id="selectDicCompType"><spring:message code="message.button.seachSpacing"/></button>
                </div>
                </div>
            </div>
        </div>
        <table class="jqgrid" id="gridlist"></table>
        <div id="gridpage"></div>
        <div class=" box box-warning bottongroup">
              <a href="toSetPaynotice.html" class="btn btn-default btn-sm" ><spring:message code="message.button.getBackSpacing"/></a>
        </div> 
    </section>
		<%@ include file="/WEB-INF/component/commonJS.jsp"%>
		<script type="text/javascript">
		   //绑定回车
		   $('#goodsCode').bind('keydown', function(event) { 
		       if (event.keyCode == "13") {
		           $('#selectDicCompType').click();
		       }
		   });	
		   $("#goodsCode").focus();//加载页面光标在第一个查询框内
		
		 
		$(function () {
			jQuery("#gridlist").jqGrid({
    			url: "${ctx}/setPaynotice/getSetPaynoticeDetailListzx.html",
    		    mtype: "POST",
    			datatype: "json",
    			postData:{
    				"noticeId" : "${noticeId}"
    			},
    			autowidth: true,
    			shrinkToFit: true,
    			height: 283,
    		   	colNames:[ '<spring:message code="message.jieSuan.caiGouMingXi"/>id',
    		   	           '<spring:message code="message.jieSuan.jiaoKuan"/>ID',
    		   	           '<spring:message code="message.jieSuan.peiSongMingXi"/>id',
    		   	           '<spring:message code="message.jieSuan.shangPinBianMa"/>',
    		   	           '<spring:message code="message.listForm.yaoPin"/>id', 
    		   	           '<spring:message code="message.listForm.tongYongMing"/>', 
    		   	           '<spring:message code="message.jieSuan.caiGouJia"/>',
    		   	           '<spring:message code="message.jieSuan.caiGouShuLiang"/>', 
    		   	           '<spring:message code="message.jieSuan.daoHuoShuLiang"/>',
    		   	           '<spring:message code="message.jieSuan.zongJinE"/>', 
    		   	           '<spring:message code="message.jieSuan.jiaoKuanTongZhiKaiShiTime"/>',
    		   	           '<spring:message code="message.jieSuan.jiaoKuanTongZhiJieShuTime"/>',
    		   	           '<spring:message code="message.jieSuan.shiFouNaRUQingDan"/>',
    		   	           'recpOrgId',
    		   	           'repOrderCount',
    		   	           'orgId',
    		   	           '<spring:message code="message.jieSuan.shangJiZhangHu"/>',
                           '<spring:message code="message.jieSuan.shangJiMingCheng"/>' 
    		   	           ],
    		   	colModel:[
    				{ name: 'orderId', width:160,hidden:true,align:"center" ,sortable:false},
    				{ name: 'noticeId', width:160,hidden:true,align:"center" ,sortable:false},
    				{ name: 'delDetailId',hidden:true, width:160,align:"center" ,sortable:false},
    				{ name: 'goodsCode', width:160,align:"center" ,sortable:false},
    				{ name: 'drugId', width:200,hidden:true, align:"center",sortable:false},
    				{ name: 'drugName', width:150,hidden:true, align:"center",sortable:false},
    				{ name: 'proPrice', width:100, align:"right",sortable:false,
                 	   formatter:function(cellvalue, options, row){
                           return formatAmount(cellvalue, options, row);
                       }
    					},
    		   		{ name: 'proCount', width:80, align:"center",sortable:false,
   						 formatter:function(cellvalue, options, row) {
   		                   		return cellvalue==null?0:cellvalue;
   		                   	}
    		   		},
    		   		{ name: 'recpCount', width:80, align:"center",sortable:false},
    		   		{ name: 'amount', width:100,align:"right" ,sortable:false,
                        formatter:function(cellvalue, options, row) {
                        	return formatAmount(cellvalue, options, row);
                        }
                    },
    		   		{ name: 'settleSchBegTime', width:180,align:"center",sortable:false},
    		   		{ name: 'settleSchEndTime', width:180,align:"center",sortable:false},
    		   		{ name: 'isInSettleSlip',hidden:true, width:180,align:"center",sortable:false},
    		   		{ name: 'recpOrgId', width:180,hidden:true,align:"center",sortable:false},
    		   		{ name: 'repOrderCount',hidden:true, width:180,align:"center",sortable:false},
    		   	    { name: 'orgId', width:160,hidden:true,align:"center" ,sortable:false},
    		   	    { name: 'fatherOrgId', width:160,hidden:true,align:"center" ,sortable:false},
    		   	    { name: 'fatherOrgName', width:160,hidden:true,align:"center" ,sortable:false}
    		   	],
    			 rowNum: 20,
    		     rowList: [10, 20, 50, 100],
    		     rownumbers: true,
    		     pager: "#gridpage",
    		     viewrecords: true,
    		     gridComplete: function(){
      	        	 //序号列宽度自适应（参数为jqgridID）
      	               autoRNWidth("gridlist");
      	           	//数据只有一条时默认选中（参数为jqgridID）
      	               selectByOneData("gridlist");
      			},
    		     caption: "<spring:message code="message.jieSuan.jiaoKuanTongZhiShu"/><spring:message code="message.jqGrid.cz.xiangQing"/><spring:message code="message.listForm.lieBiao"/>",
    		     jsonReader: {
    		         repeatitems: false,
    		         id: "ids"
    		     }
    		});
            
            $("#gridlist").jqGrid('navGrid', '#gridpage', { add: false, edit: false, del: false, search: false, refresh: false });
            
            $(window).trigger("resize");
            
        });
			
	
		//查询
        function gridSerch() {
        	var delDetailId = $.trim($("#delDetailId").val());
        	var goodsCode = $.trim($("#goodsCode").val());
    		$("#gridlist").jqGrid('setGridParam',{  
    	        datatype:'json',
    	        postData:{
    	        		"delDetailId":delDetailId,
    	        		"goodsCode":goodsCode},
    	        		page:1
    	    }).trigger("reloadGrid"); //重新载入  
    	}
        
   	 //回调
		 function operResult(val){
	        	var strs = new Array();
	            strs = val.split("|$");
	      
	            	if (val.length>0) {
						$('#'+strs[0]).val(strs[2]);
					}
					if (val.length>0) {
						$('#'+strs[1]).html(strs[3]);
					}
	        }
			 
</script>
</body>
</html>